<?php
include_once "../config/constants.php";

//	$br = "<br/>";
//	echo $_SERVER[REMOTE_ADDR].$br;
//	echo time().$br;
//	echo date("Y-m-d H:i:s", time()).$br;


// svtAjaxAddEvent
// _mid
// _eventid
// _timestamp
// _extradata

if(!$_eventid && $_GET[_eventid])
	$_eventid = $_GET[_eventid];
if(!$_extradata && $_GET[_extradata])
    $_extradata = $_GET[_extradata];

if($_eventid && $_extradata)
{
//	$_timestamp = "".date("Y-m-d H:i:s", time());
	$_timestamp = "".(time()*1000);
	$_mid = "110";

	$reqe = new HttpRequest(EVENTLOG_PORTAL, HttpRequest::METH_POST);
	$reqe->addPostFields(array('_mid'=>$_mid));
    $reqe->addPostFields(array('_eventid'=>$_eventid));
    $reqe->addPostFields(array('_timestamp'=>$_timestamp));
    $reqe->addPostFields(array('_extradata'=>$_extradata));
	$bodye = $reqe->send()->getBody();
	echo $bodye;
}else
	echo "ERROR: empty argument".$_eventid.$_extradata;
echo time();
echo date("Y-m-d H:i:s", time());
?>
